package com.itheima.gouzao;

public class Test {

    public static void main(String[] args) {
        /*A a = new A();
        A a2 = new A();

        A a1 = new A(10);
        A a23 = new A(10);*/
       // Fu fu = new Fu();
     /*   Zi zi = new Zi();
        Zi zi1 = new Zi();*/
        Zi zi = new Zi();
        Zi zi2 = new Zi(10);
        //Fu fu = new Fu();

    }
}
 class Fu extends Object{
    int i=10;
    public Fu(){
        System.out.println("父类的无参构造");
    }
     public Fu(int a){
         System.out.println("父类的有参构造");
     }
}
class Zi extends Fu{
    public Zi(){
        //
       super() ; // this(10);
        // 系统帮我们调用了父类的构造方法  先得有爹 才能有儿子
        System.out.println("子类的无参构造");
    }
    public Zi(int a){
        super(10);
        // 系统帮我们调用了父类的构造方法  调用的是父类的无参
        System.out.println(i);
        System.out.println("zi类的有参构造");
    }



}
















class A {
    public A(){
        System.out.println("无参构造");
    }
    public A(int a){
        System.out.println("带参构造");
    }
}

